home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Text / Digest-Browser-1.6 Folder / Application / Browser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-29  |  1.7 KB  |  67 lines  |  [TEXT/KAHL]

  1. /* Browser.h */
  2.  
  3. #pragma once
  4.  
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7.  
  8. // Macros to make life easy
  9. #define Allocate(aType) (aType *) NewPtr(sizeof(aType))
  10. #define Deallocate(Var) if (Var) { DisposPtr(Var); Var = NULL;}
  11.  
  12. #define MAX_STRING 200
  13.  
  14. typedef struct BrowserItem {
  15.     struct BrowserItem *next;
  16.     void    *owner;        //really a struct BrowserDirPtr owner;
  17.     FILE    *fp;
  18.  
  19.     char     date[MAX_STRING];
  20.     char     from[MAX_STRING];
  21.     char     subject[MAX_STRING];
  22.     char     composite[MAX_STRING];    // JRB support composite index
  23.     long     startAt;
  24.     long     endAt;
  25.     Boolean  marked;
  26. } BrowserItem, *BrowserItemPtr;
  27.  
  28.  
  29. typedef struct BrowserDir {
  30.     char    fname[64];        // file name
  31.     short    vRefNum;        // volume ref.
  32.     FILE    *fp;            // file pointer
  33.     long    numArticles;    // count of items
  34.     long    markArticles;    // count of marked items
  35.  
  36.     BrowserItemPtr topItem;
  37. } BrowserDir, *BrowserDirPtr;
  38.  
  39. Boolean equalstr(register char *s, register char *t, int n);
  40. Boolean BuildBrowserIndex(BrowserDir    *dir);
  41.  
  42. void    brInitDir(BrowserDirPtr dir);
  43. long    brItemCount(BrowserDirPtr dir);
  44. long    brMarkCount(BrowserDirPtr dir);
  45.  
  46. void    brInitItem(BrowserItemPtr item);
  47.  
  48. void    brSetOwner(BrowserItemPtr item, BrowserDirPtr dir);
  49. BrowserDirPtr    brGetOwner(BrowserItemPtr item);
  50.  
  51. void    brSetFP(BrowserItemPtr item, FILE *file);
  52. FILE    *brGetFP(BrowserItemPtr item);
  53.  
  54. void    brSetStart(BrowserItemPtr item, long start);
  55. long    brGetStart(BrowserItemPtr item);
  56.  
  57. void    brSetEnd(BrowserItemPtr item, long end);
  58. long    brGetEnd(BrowserItemPtr item);
  59.  
  60. void    brToggleMark(BrowserItemPtr item);
  61. void    brSetMark(BrowserItemPtr item, Boolean mark);
  62. Boolean    brGetMark(BrowserItemPtr item);
  63.  
  64. void    brSetNext(BrowserItemPtr item, BrowserItemPtr nxt);
  65. BrowserItemPtr    brGetNext(BrowserItemPtr item);
  66.  
  67.